#include <guiconstantsex.au3>
#include <guiedit.au3>
#include <StaticConstants.au3>

Opt("GUIOnEventMode", 1)
$frmMain = GUICreate( "stringLen", 310, 50 )
GUISetOnEvent($GUI_EVENT_CLOSE, "GUI_EVENT_CLOSE" )
$count = GUICtrlCreateLabel( "0 characters.", 100, 5, 100, 20, $SS_CENTER )
$edit = GUICtrlCreateInput( "", 5, 25, 300, 20 )
GUISetOnEvent( $edit, "editChange" )
GUISetState(@SW_SHOW)

dim $string

while 1
	$string = GUICtrlRead( $edit )
	Sleep(10)
	if GUICtrlRead( $edit ) <> $string Then editChange()
WEnd

Func GUI_EVENT_CLOSE()
	GUIDelete()
	Exit
EndFunc

Func editChange()
	if StringLen( GUICtrlRead( $edit ) ) = 1 Then
		GUICtrlSetData( $count, "1 character." )
	Else
		GUICtrlSetData( $count, StringLen( GUICtrlRead( $edit ) ) & " characters." )
	EndIf
EndFunc